#!/usr/bin/perl
#
open(NUMS,$ARGV[0]);
while($line=<NUMS>) {
	chomp($line);
	$number{$line} = 1;
}
close(NUMS);

$senNum=1;
while($line=<STDIN>) {
	chomp($line);
	if($number{$senNum}) {
		print $line."\n";
	}
	$senNum++;
}
